package com.wtc.main;

import com.wtc.dao.UserDao;
import com.wtc.entity.User;
import com.wtc.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    @Test
    public void test() {
        String config = "bean.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        UserService service = ac.getBean("b",UserService.class);
        User a = ac.getBean("a", User.class);
        service.add(a);
        System.out.println(a);
    }
}
